package core.db.entity.clarkGame;

import com.ddm.server.annotation.DataBaseField;
import com.ddm.server.annotation.TableName;
import core.db.entity.BaseEntity;
import core.ioc.Constant;
import lombok.Data;
import lombok.NoArgsConstructor;


@TableName(value = "banCity" )
@Data
@NoArgsConstructor
public class BanCityBO extends BaseEntity<BanCityBO> {

    @DataBaseField(type = "bigint(20)", fieldname = "id", comment = "自增主key",indextype = DataBaseField.IndexType.Unique)
    private long id;
	@DataBaseField(type = "int(11)", fieldname = "value", comment = "值")
    private int value;
	@DataBaseField(type = "int(11)", fieldname = "type", comment = "类型")
    private int type;
    @DataBaseField(type = "int(11)", fieldname = "banType", comment = "禁止类型")
    private int banType;


    public BanCityBO(int value, int type, int banType) {
        this.value = value;
        this.type = type;
        this.banType = banType;
    }


    public static String getSql_TableCreate() {
        String sql = "CREATE TABLE IF NOT EXISTS `banCity` ("
                + "`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增主键',"
                + "`value` int(11) NOT NULL DEFAULT '0' COMMENT '值',"
                + "`type` int(11) NOT NULL DEFAULT '0' COMMENT '类型',"
                + "`banType` int(11) NOT NULL DEFAULT '0' COMMENT '禁止类型',"
                + "PRIMARY KEY (`id`),"
                + "UNIQUE KEY `value_type` (`value`,`type`) USING BTREE"
                + ") COMMENT='禁止城市游戏'  DEFAULT CHARSET=utf8 AUTO_INCREMENT=" + (Constant.InitialID + 1);
        return sql;
    }
}
